{#如果只有一个Master则说明是单Master架构#}
{% if groups['kube_master'] | length == 1 %}
    {% set apiserver = groups['kube_master'][0] + ':' + '6443' %}
{% elif groups['kube_master'] | length > 1 %}
    {% set apiserver = vip + ':' +  '16443' %}
{% endif %}

apiVersion: v1
clusters:
- cluster:
    certificate-authority: {{ k8s_link_dir }}/ssl/ca.pem
    server: https://{{ apiserver }}
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: kubelet-bootstrap
  name: default
current-context: default
kind: Config
preferences: {}
users:
- name: kubelet-bootstrap
  user:
    token: jkw93369gf5ca361d31d225e239f601c
